#include <iostream>
#include <string>
#include <map>
#include "CObject.h"

struct IPlay
{
    virtual void play(std::string str) = 0;
};

class CA : public IPlay
{
public:
    virtual void play(std::string str) override
    {
        std::cout << "CA: " << str << std::endl;
    }
};

REGISTER_CLASS(CA)

class CFactory
{
public:
    static IPlay* CreateInstance()
    { 
        return static_cast<IPlay*>(CObject::CreateObject("CA")); 
    }
};

int main()
{
    IPlay* lpIPlay = CFactory::CreateInstance();
    lpIPlay->play("Nice");

    return 0;
}